﻿using DHQGHN.DAL.DAO.DHQG;
using DHQGHN.DAL.Models.DHQG;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DHQGHN.DAL.BO.DHQG
{
    public class DonViChiTieuBO :BaseBO
    {
        private DonVi_ChiTieuDAO _dao;
        public DonViChiTieuBO()
        {
            _dao = new DonVi_ChiTieuDAO(Common.ConnectionUtil.DHQGHN_CONNECTION_STRING, DEFAULT_MAPPER_TYPE);
        }
        public int DeleteDonViChiTieuByNKH(int namkhid,int donviid, int flag)
        {
            try
            {
                return _dao.DeleteDonViChiTieuByNKH(namkhid, donviid, flag);
            }
            catch
            {
                throw;
            }
        }
        public int DeleteDonViChiTieuRiengByNKH(int namkhid, int donviid)
        {
            try
            {
                return _dao.DeleteDonViChiTieuRiengByNKH(namkhid, donviid);
            }
            catch
            {
                throw;
            }
        }
        public List<DonViChiTieu> GetAllDvCtbyNKH(int namkhid, int flag)
        {
            try
            {
                return _dao.GetAllDvCtbyNKH(namkhid, flag);
            }
            catch
            {
                throw;
            }
        }
        public bool Save(List<DonViChiTieu> data)
        {
            try
            {
                return _dao.Save(data);
            }
            catch
            {
                throw;
            }
        }
        public List<DonViChiTieu> GetAllByDV(int namkhid, int donviid)
        {
            try
            {
                return _dao.GetAllByDV(namkhid, donviid);
            }
            catch
            {
                throw;
            }
        }
        public List<DonViChiTieu> GetChitieuriengbydv(int namkhid, int donviid)
        {
            try
            {
                return _dao.GetChitieuriengbydv(namkhid, donviid);
            }
            catch
            {
                throw;
            }
        }
    }
}
